<?php session_start(); ?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>:: BYKOM ::</title>
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
-->
</style>
<script type="text/JavaScript">

function Recargar(pag)
   {
    document.frmParametros.pag.value=pag;
   	document.frmParametros.submit();
   }

</script>
<?php include ("config.php");?>
<link href="<?php echo ESTILO?>/bykom.css" rel="stylesheet" type="text/css">

<?php
   if (isset($_SESSION['cliente']))
   {
  /*include(ROOT_DIR_CLASES.'/cCliente.php');
   $cuenta=$_REQUEST['v'];
   $fechai = $_REQUEST['anoi'].'-'.$_REQUEST['mesi'].'-'.$_REQUEST['diai']." ".$_REQUEST['horaInicio'].':00';
   $fechaf = $_REQUEST['anof'].'-'.$_REQUEST['mesf'].'-'.$_REQUEST['diaf']." ".$_REQUEST['horaFin'].':59';
   $pag=$_REQUEST['pag'];
   $nom1nom2=$_REQUEST['nom1nom2'];
   $codigocuenta=$_REQUEST['codigocuenta'];
   $tipoConsulta = "Historico Avl";
      
   
   $reg_actual=(($pag-1)*RESULTADO_HISTORICO_AVL);
   $consulta=BykomCliente::Consulta_Historico_Avl($cuenta,$fechai,$fechaf,0,1);  
   $cant_reg=$consulta->campo('cantidad',0);
   $velocidadPromedio = substr($consulta->campo('promedio',0), 0, strpos($consulta->campo('promedio',0), '.')+4);
   $velocidadMax = substr($consulta->campo('velocidadMax',0), 0, strpos($consulta->campo('velocidadMax',0), '.')+4);
   
   $consulta=BykomCliente::Consulta_Historico_Avl($cuenta,$fechai,$fechaf,$reg_actual,0);
   
   $consultaTotal=BykomCliente::Consulta_Historico_Avl($cuenta,$fechai,$fechaf,0,0);
   $distanciaTotal = BykomCliente::Consulta_Distancia_Total_Avl($consultaTotal);
   
   //echo "Distancia total: ".$distanciaTotal." metros\n";
   //echo "Velocidad Maxima: ".$velocidadMax." Km/h\n";
   //echo "Velocidad Promedio: ".$velocidadPromedio." Km/h\n";
   
   $filtro="Seleccionar todos desde ".$_REQUEST['horaInicio']." ".$_REQUEST['diai']."/".$_REQUEST['mesi']."/".$_REQUEST['anoi']." hasta ".$_REQUEST['horaFin']." ".$_REQUEST['diaf']."/".$_REQUEST['mesf']."/".$_REQUEST['anof'];
   $res=RESULTADO_HISTORICO_AVL; */                         
   
 
     echo 
       "<FORM NAME='frmParametros' METHOD='post'> 
          <input type='hidden' name='v' value='".$cuenta."'>
          <input type='hidden' name='nom1nom2' value='".$nom1nom2."'>
          <input type='hidden' name='fechai' value='".$_REQUEST['diai']."'>
          <input type='hidden' name='fechai' value='".$_REQUEST['mesi']."'>
          <input type='hidden' name='fechai' value='".$_REQUEST['anoi']."'>
          <input type='hidden' name='horaInicio' value='".$_REQUEST['horaInicio']."'>
          <input type='hidden' name='fechai' value='".$_REQUEST['diaf']."'>
          <input type='hidden' name='fechai' value='".$_REQUEST['mesf']."'>
          <input type='hidden' name='fechai' value='".$_REQUEST['anof']."'>
          <input type='hidden' name='horaFin' value='".$_REQUEST['horaFin']."'>
          <input type='hidden' name='pag' value='".$pag."'>
        </FORM>";

?>
<form name="frmHistoricoAvl" action="Reporteador_Avl_Recorrido.php">
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td align="center" valign="middle"><table width="780" border="0" cellpadding=" " cellspacing="0">
      <tr>
        <td height="20" align="center" valign="middle"><span class="txtbase"><img src="imagenes/head-datos.jpg" width="780" height="20" align="absmiddle"></span></td>
      </tr>
      <tr>
        <td height="492" align="center" valign="top" bgcolor="#E8E8E8"><table width="100%" border="0" cellspacing="0" cellpadding="10">
          <tr>
            <td colspan="2" align="center" valign="middle"><table width="752" border="0" cellpadding="0" cellspacing="0">
              <tr>
                <td align="left" valign="middle"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td><img src="imagenes/banner_arriba.jpg" width="752" height="17"></td>
                    </tr>
                    <tr>
                      <td align="left" valign="top" bgcolor="#F4F4F4"><table width="100%" height="50" border="0" cellpadding="0" cellspacing="0">
                          <tr>
                            <td width="1%"><img src="imagenes/n.gif" width="10" height="10"></td>
                            <td width="7%" align="left" valign="middle"><span class="titulo">CUENTA: </span></td>
                            <td width="62%" align="left" valign="middle">&nbsp;</td>
                            <td width="30%" rowspan="2" align="left" valign="middle"><img src="imagenes/logo2.jpg" width="200" height="61"></td>
                          </tr>
                          <tr>
                            <td>&nbsp;</td>
                            <td colspan="2" align="left" valign="top" class="texto"><p>&nbsp;</p></td>
                          </tr>
                          <tr>
                            <td>&nbsp;</td>
                            <td align="left" valign="top" class="texto"><span class="titulo">Filtro</span>:</td>
                            <td align="left" valign="top" class="texto">&nbsp;</td>
                            <td align="left" valign="middle">&nbsp;</td>
                          </tr>
                      </table></td>
                    </tr>
                </table></td>
              <tr>
                <td><img src="imagenes/banner_abajo.jpg" width="752" height="17"></td>
              </tr>
            </table></td>
          </tr>
          <tr>
            <td width="500" rowspan="2" align="center" valign="middle"><img src="imagenes/mapa.jpg" width="480" height="500"></td>
            <td width="260" align="left"><table width="240" border="0" cellpadding="0" cellspacing="0" bgcolor="#F4F4F4">
              <tr>
                <td width="20" height="20"><img src="imagenes/punta_izq_sup.jpg" width="20" height="20"></td>
                <td>&nbsp;</td>
                <td width="20" height="20"><img src="imagenes/punta_der_sup.jpg" width="20" height="20"></td>
              </tr>
              <tr>
                <td rowspan="5">&nbsp;</td>
                <td bgcolor="#F4F4F4">&nbsp;</td>
                <td rowspan="5">&nbsp;</td>
              </tr>
              <tr>
                <td bgcolor="#F4F4F4">&nbsp;</td>
              </tr>
              <tr>
                <td bgcolor="#F4F4F4">&nbsp;</td>
              </tr>
              <tr>
                <td bgcolor="#F4F4F4">&nbsp;</td>
              </tr>
              <tr>
                <td bgcolor="#F4F4F4">&nbsp;</td>
              </tr>
              <tr>
                <td><img src="imagenes/punta_izq_inf.jpg" width="20" height="20"></td>
                <td>&nbsp;</td>
                <td><img src="imagenes/punta_der_inf.jpg" width="20" height="20"></td>
              </tr>
            </table></td>
          </tr>
          <tr>
            <td align="left" valign="top"><table width="240" border="0" cellpadding="0" cellspacing="0" bgcolor="#F4F4F4">
              <tr>
                <td width="20" height="20"><img src="imagenes/punta_izq_sup.jpg" width="20" height="20"></td>
                <td>&nbsp;</td>
                <td width="20" height="20"><img src="imagenes/punta_der_sup.jpg" width="20" height="20"></td>
              </tr>
              <tr>
                <td rowspan="5">&nbsp;</td>
                <td bgcolor="#F4F4F4"><img src="imagenes/prueba.gif" width="200" height="201" border="0" usemap="#Map"></td>
                <td rowspan="5">&nbsp;</td>
              </tr>
              <tr>
                <td bgcolor="#F4F4F4">&nbsp;</td>
              </tr>
              <tr>
                <td bgcolor="#F4F4F4">&nbsp;</td>
              </tr>
              <tr>
                <td bgcolor="#F4F4F4">&nbsp;</td>
              </tr>
              <tr>
                <td bgcolor="#F4F4F4">&nbsp;</td>
              </tr>
              <tr>
                <td><img src="imagenes/punta_izq_inf.jpg" width="20" height="20"></td>
                <td>&nbsp;</td>
                <td><img src="imagenes/punta_der_inf.jpg" width="20" height="20"></td>
              </tr>
            </table></td>
          </tr>
        </table></td>
          </tr>
      <tr>
        <td height="20" align="center" valign="top" bgcolor="#E8E8E8"><img src="imagenes/foot-datos.jpg" width="780" height="20"></td>
      </tr>
        </table></td>
      </tr>
      <tr>
        <td height="20" align="center" valign="middle">&nbsp;</td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td align="center" valign="middle">&nbsp;</td>
  </tr>
</table>
<?php 
   }
   else echo "<font class=Errors> Debe iniciar session para poder visualizar esta pagina.</font>";
?>
</form>

<map name="Map"><area shape="rect" coords="3,75,45,120" href="#">
<area shape="circle" coords="63,60,18" href="#"></map></body>
</html>
